[Unit]
Description=Thanos Bucket

[Service]
{% if ansible_processor_vcpus > 1 %}
Environment=GOMAXPROCS={{ (ansible_processor_vcpus * 0.5 + 1)|int }}
{% else %}
Environment=GOMAXPROCS=1
{% endif %}
Type=simple
User=prometheus
Group=prometheus
LimitNOFILE={{ thanos_arg.ulimit_nofile }}
LimitNPROC={{ thanos_arg.ulimit_nproc }}
LimitCORE={{ thanos_arg.ulimit_core }}
LimitMEMLOCK={{ thanos_arg.ulimit_memlock }}
EnvironmentFile=-/etc/default/thanos-bucket
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=thanos-bucket
ExecStart=/usr/bin/thanos tools bucket web $THANOS_BUCKET_OPTS
Restart=on-failure
RestartSec=30s

[Install]
WantedBy=multi-user.target
